package com.itheima.app.manager.pmsManager;


import com.itheima.commons.R;
import com.itheima.domain.db.pms.PmsSkuStock;
import com.itheima.service.pmsService.PmsSkuStockService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class PmsSkuStockManager {

    @DubboReference
    PmsSkuStockService pmsSkuStockService;

    public R updateByIdList(Integer pid, PmsSkuStock [] pmsSkuStock) {

        pmsSkuStockService.updateByIdList(pid,pmsSkuStock);

        return R.ok(null);
    }

    public R selectByIdSku(Integer pid, String skuCode) {

        List<PmsSkuStock> pmsSkuStockList = pmsSkuStockService.selectByIdSku(pid,skuCode);

        return R.ok(pmsSkuStockList);
    }
}
